<style scoped>
.wsplus-body {}
</style>
<template>
    <section class="wsplus-body">
        <ws-header></ws-header>
         <ws-content></ws-content> 
        <!--<router-view></router-view>-->
        <ws-im v-if="isKefu" :tokenId="tokenId" :isCustomerCare="isCustomerCare" :mine="getMine"></ws-im>
    </section>
</template>
<script>
import wsHeader from './header.vue';
import wsContent from './content.vue';
import LoginEvent from '@/event/login-event.js';
export default {
    components: {
        wsHeader,
        wsContent
    },
    data() {
        return {
            isCustomerCare: true
        }
    },
    computed: {
        tokenId() {
            let tokenId = this.$store.getters.auth_token_id;
            return tokenId;
        },
        isKefu() {
            let obj = this.$store.getters.auth_context_params;
            if (obj && obj.kefu) {
                return true;
            }
            return false;
        },
        getMine() {
            let obj = this.$store.getters.auth_context_params;
            let loginName_ = this.$store.getters.auth_loginName;
            let u = this.$store.getters.auth_user,
                tenantId = u ? u.tenantId : '',
                SEPARATOR = '_';
            if (obj && obj.kefu) {
                mine = {
                    "username": obj.kefu.nickname || 'AllSale',
                    "uid": obj.kefu.uid,
                    "status": "online",
                    "sign": '',
                    "avatar": obj.kefu.portraitUri || '',
                    "kefuGroupId": obj.kefu.groupId
                }
                return mine;
            }
            return {};
        }
    },
    mounted() {
		LoginEvent.init();
    },
    methods: {}
}
</script>